package yzq.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import yzq.entity.User;
import yzq.mapper.UserMapper;
import yzq.service.UserService;

@Service
@Transactional
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserMapper userMapper;
	
	@Cacheable(value="UserCache",key="'user.getAllUsers'")
	public List<User> getAllUsers(){
		return this.userMapper.getAllUsers();
	}
	
	public void deleteUser(Integer id) {
		System.out.println("删除了"+id);
		this.userMapper.delete(id);
	}
}
